package com.codeoss.module.res.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.codeoss.framework.service.impl.BaseService;
import com.codeoss.module.res.dao.ResRelUserRoleMapper;
import com.codeoss.module.res.model.ResRelUserRole;
import com.codeoss.module.res.service.IResRelUserRoleService;

@Service
public class ResRelUserRoleService extends BaseService<ResRelUserRoleMapper, ResRelUserRole>
		implements IResRelUserRoleService {

	@Override
	public List<Long> getRoleIdListByUserId(Long resUserId) {
		// TODO Auto-generated method stub
		List<Long> idList=new ArrayList<Long>();
		QueryWrapper<ResRelUserRole> query=new QueryWrapper<ResRelUserRole>();
		query.eq("res_user_id", resUserId);
		List<ResRelUserRole> relList=list(query);
		for(ResRelUserRole resRelUserRole:relList) {
			idList.add(resRelUserRole.getResRoleId());
		}
		return idList;
	}
}